package com.ondb.main;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.AbstractHandler;

/**
 * <br>Ondb web service
 * @author admin
 * @version Ondb.java (Sep 2, 2012 11:40:13 PM)
 */
public class Ondb extends AbstractHandler 
{
  public static void main(String[] args) throws Exception
  {
	Server server = new Server(9090);
	server.setHandler(new Ondb());
	
	server.start();
	server.join();
  }
  
  /*
   * Overridden method
   */
  @Override
  public void handle(String target, Request baseRequest,
	  HttpServletRequest request, HttpServletResponse response)
	  throws IOException, ServletException
  {
	response.setContentType("text/html;charset=utf-8");
	response.setStatus(HttpServletResponse.SC_OK);
	baseRequest.setHandled(true);
	response.getWriter().println("<h1>Hello World</h1>");  
  }
}
